import * as React from 'react';
import * as ReactDOM from 'react-dom';
import App from './App';
import './index.css';
import { composeAsync, compose, aisleAsync } from 'grey-group-function';


ReactDOM.render(
    <App />,
    document.getElementById('root') as HTMLElement
);

const fn1 = async (s: string) => {
    debugger;
    return s + '+1';
}
const fn2 = (s: string) => {
    debugger;
    return s + '+1';
}
const fnu = (s: string) => {
    debugger;
    return null;
}

const fns1 = composeAsync<string, string>(fn1, fnu, fn1, fn1);
const fns2 = compose<string, string>(fn2, fnu, fn2, fn2);
const fns3 = aisleAsync(fn2, fnu, fn2, fn2, () => { });

(async () => {

    console.log(await fns1('xxx'));
    console.log(fns2('xxx'));
    console.log(fns3('xxx'));
})()